package com.mt.mall.entity.merchant;

import javax.persistence.*;
import java.io.Serializable;

import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


import com.mt.common.system.entity.User;
import com.mt.common.system.entity.Attachment;

import java.util.List;

@DEntity(label = "店铺", comment = "", moduleLabel = "店铺")
@Entity(name = "mall_shop")
@Table(name = "mall_shop", indexes = {@Index(name = "index_user_id", columnList = "user_id")})
@ApiModel(description = "店铺:")
public class Shop extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @DColumn(index = 3, label = "拥有者", foreignEntity = "User", comment = "拥有者", component = "对象选择", where = true)
    @ApiModelProperty(value = "拥有者:拥有者")
    @Column(name = "user_id", length = 255, nullable = true, unique = false)
    private Long userId;

    @Transient
    private User user;

    @Transient
    @ApiModelProperty(value = "拥有者名称:拥有者")
    @DColumn(index = 3, label = "拥有者", foreignEntity = "User", comment = "拥有者")
    private String userName;

    @DColumn(index = 4, label = "店铺描述", comment = "", component = "文本", where = false)
    @ApiModelProperty(value = "店铺描述:")
    @Column(name = "description", length = 255, nullable = true, unique = false)
    private String description;

    @DColumn(index = 5, label = "地址", comment = "地址", component = "文本", where = false)
    @ApiModelProperty(value = "地址:地址")
    @Column(name = "adress", length = 255, nullable = true, unique = false)
    private String adress;

    @Transient
    private List<Attachment> attachments;

    @DColumn(index = 6, label = "头像", comment = "头像", component = "文本", where = false)
    @ApiModelProperty(value = "头像:头像")
    @Column(name = "avatar", length = 255, nullable = true, unique = false)
    private String avatar;

    @DColumn(index = 7, label = "服务态度", comment = "服务态度", component = "文本", where = false)
    @ApiModelProperty(value = "服务态度:服务态度")
    @Column(name = "service_attitude", length = 255, nullable = true, unique = false)
    private Integer serviceAttitude;

    @DColumn(index = 8, label = "粉丝数量", comment = "粉丝数量", component = "文本", where = false)
    @ApiModelProperty(value = "粉丝数量:粉丝数量")
    @Column(name = "fans", length = 255, nullable = true, unique = false)
    private Long fans;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Long getUserId() {
        return this.userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAdress() {
        return this.adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public List<Attachment> getAttachments() {
        return this.attachments;
    }

    public void setAttachments(List<Attachment> attachments) {
        this.attachments = attachments;
    }

    public Integer getServiceAttitude() {
        return this.serviceAttitude;
    }

    public void setServiceAttitude(Integer serviceAttitude) {
        this.serviceAttitude = serviceAttitude;
    }

    public Long getFans() {
        return this.fans;
    }

    public void setFans(Long fans) {
        this.fans = fans;
    }

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        if (user == null) {
        } else {
            this.userId = user.getEid();
            this.user = user;
        }
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }


}
